-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Session cost add message #1007
base: main
Are you sure you want to change the base?
Session cost add message #1007
Conversation
lib/ocpp/v16/charge_point_impl.cpp
Outdated
if (!messages.empty()) { | ||
session_cost_message.message = messages; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And you can drop this
if (!messages.empty()) { | |
session_cost_message.message = messages; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
then the messages are not included?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should now be able to drop
#include <ocpp/v2/functional_blocks/display_message.hpp>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not build in that case: it is missing message_content_to_display_message_content
then
…cing information. Signed-off-by: Maaike Zijderveld, iolar <git.mail@iolar.nl>
Signed-off-by: Maaike Zijderveld, iolar <git.mail@iolar.nl>
Signed-off-by: Maaike Zijderveld, iolar <git.mail@iolar.nl>
343ea0a
to
07368e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, please see just a couple of remarks inline
|
||
## OCPP 2.0.1 | ||
|
||
OCPP 2.0.1 uses different mechanisms to send pricing information. The messages are converted to internally used structs as descripbed above. For California Pricing Requirements to work, DisplayMessage and TariffAndCost must be implemented as well. | ||
OCPP 2.0.1 uses different mechanisms to send pricing information. The messages are converted to internally used structs as descripbed above. For California Pricing Requirements to work, TariffAndCost must be implemented as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OCPP 2.0.1 uses different mechanisms to send pricing information. The messages are converted to internally used structs as descripbed above. For California Pricing Requirements to work, TariffAndCost must be implemented as well. | |
OCPP 2.0.1 uses different mechanisms to send pricing information. The messages are converted to internally used structs as described above. For California Pricing Requirements to work, TariffAndCost must be implemented as well. |
|
||
For the tariff information (the personal messages), the `set_display_message_callback` is used. The same callback is also used for the SetDisplayMessageRequest in OCPP. The latter does require an id, the former will not have an id. So when `GetDisplayMessageRequest` is called from the CSMS, the Tariff display messages (that do not have an id) should not be returned. They should also be removed as soon as the transaction has ended. | ||
For the tariff information (the personal messages), the `session_cost_message_callback` is used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the tariff information (the personal messages), the `session_cost_message_callback` is used. | |
For the tariff information (the personal messages), the `session_cost_message_callback` is used. |
@@ -161,6 +161,9 @@ struct Callbacks { | |||
std::optional<std::string> currency_code)>> | |||
set_running_cost_callback; | |||
|
|||
/// \brief Callback function is called when tariff message is set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// \brief Callback function is called when tariff message is set. | |
/// \brief Callback function is called when a tariff message from the CSMS message has been received. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would help to give a little bit more context here and to describe whats expected from the callback.
include/ocpp/v16/charge_point.hpp
Outdated
@@ -573,6 +573,12 @@ class ChargePoint { | |||
const std::function<DataTransferResponse(const RunningCost& session_cost, const uint32_t number_of_decimals)>& | |||
session_cost_callback); | |||
|
|||
/// \brief Registers a callback function for the session cost text message (California Pricing Requirements). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would help to give a little bit more context here and to describe whats expected from the callback.
Signed-off-by: Piet Gömpel <pietgoempel@gmail.com>
Describe your changes
Do not use the display message interface to send session cost messages, but use a specific session cost message type.
Issue ticket number and link
Checklist before requesting a review